-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Prehash visibilities in resolver #143371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Prehash visibilities in resolver #143371
Conversation
aaaefd1
to
17c75cb
Compare
17c75cb
to
11751ce
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Prehash visibilities in resolver Based on #143247 r? `@ghost` for perf
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (556648c): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.9%, secondary -2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 461.146s -> 462.46s (0.28%) |
11751ce
to
2a49c4c
Compare
let visibilities_hash = { | ||
let mut hasher = StableHasher::new(); | ||
let mut hcx = self.create_stable_hashing_context(); | ||
self.visibilities_for_hashing.hash_stable(&mut hcx, &mut hasher); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about doing this operation in fn feed_visibility
and keeping only the hash in Resolver
instead of the whole visibilities_for_hashing
table.
Is creating the hashing context a more or less expensive operation than adding a table element?
// the fly in the resolver, storing only their accumulated hash in `ResolverGlobalCtxt`, | ||
// and combining it with other hashes here. | ||
resolutions.visibilities_for_hashing.hash_stable(&mut hcx, &mut stable_hasher); | ||
resolutions.visibilities_hash.hash_stable(&mut hcx, &mut stable_hasher); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also wondering if this operation (including visibilities, and maybe some other parts of resolutions
, into the crate hash) needs to be performed at all, if we are hashing the whole resolutions
as a query result now.
Based on #143247
r? @ghost for perf